package com.qidian.buy.config;

import com.qidian.buy.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author 郭浩
 */
@Configuration
public class BuyWebMvcConfig implements WebMvcConfigurer {
    @Autowired//登录拦截的拦截器
    private LoginInterceptor loginInterceptor;
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/cart/**","/order/**");
    }
}
